package File;

import java.io.*;
import java.util.Arrays;

public class MyFile4 {
    public static void main(String[] args) {
/*        try (Writer writer = new FileWriter("D:\\software\\code\\2023_java\\2023_java_code\\code_24_4_17\\src\\Text.text")){
            //字符流
            //写操作
            writer.append("你好世界");
        }catch (IOException e){
            e.printStackTrace();
        }*/
        try (Reader reader = new FileReader("D:\\software\\code\\2023_java\\2023_java_code\\code_24_4_17\\src\\Text.text")){
            //字符流
            //读操作
            char[] chars = new char[10];
           int n = reader.read(chars);
            for (int i = 0; i < n; i++) {
                System.out.println(chars[i]);
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
